<!DOCTYPE html>
<html lang="en">

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0">
		<title>宝宝信息</title>
		<script type="text/javascript" src="js/init.js"></script>
		<link rel="stylesheet" type="text/css" href="css/common.css">
		<link rel="stylesheet" type="text/css" href="css/login.css">
		<link rel="stylesheet" type="text/css" href="css/sui/sm.min.css" />
	</head>

	<body>
		<div class="payBill">
			<ul class="tableList">
				<li class="tableLine header">
					<div class="leftpart fl">
						<span>
						项目名称
					</span>
					</div>
					<div class="rightpart fl">
						<span>单价（元）</span>
					</div>
					<div class="clear"></div>
				</li>
				<li class="tableLine">
					<div class="leftpart fl">
						<input class="priceSelect" type="checkbox" name="" data-num="111">
						<span>无创产前基因检测</span>
					</div>
					<div class="rightpart fl">
						<span>2000</span>
					</div>
				</li>
				<li class="tableLine">
					<div class="leftpart fl">
						<input class="priceSelect" type="checkbox" name="" data-num="222">
						<span>新生儿干细胞存储</span>
					</div>
					<div class="rightpart fl">
						<span>18000</span>
					</div>
				</li>
				<li class="tableLine">
					<div class="leftpart fl">
						<input class="priceSelect" type="checkbox" name="" data-num="333">
						<span>新生儿遗传代谢病筛查（赠送）</span>
					</div>
					<div class="rightpart fl">
						<span>600</span>
					</div>
				</li>
				<li class="tableLine">
					<div class="leftpart fl">
						<input class="priceSelect" type="checkbox" name="" data-num="444">
						<span>间充质干细胞存储</span>
					</div>
					<div class="rightpart fl">
						<span>18000</span>
					</div>
				</li>
				<li class="tableLine">
					<div class="leftpart fl">
						<input class="priceSelect" type="checkbox" name="" data-num="555">
						<span>胎盘蜕膜干细胞存储</span>
					</div>
					<div class="rightpart fl">
						<span>18000</span>
					</div>
				</li>
			</ul>
			<div class="tabpanel hide">
				<div class="buttons-tab fixed-tab" data-offset="44" style="top: 0px;">
					<a class="tab-link button active" href="#tab1">全额付款</a>
					<a class="tab-link button" href="#tab2">贷款分期</a>
					<div class="clear"></div>
				</div>
				<div class="tabs">
					<div id="tab1" class="tab active tabContent">
						<div class="tabContentRow">
							<span>订单详情</span>
						</div>
						<div class="tabContentRow checkList">
							
						</div>
						<div class="tabContentRow lastTabContentRow">
							<div class="rowContent">
								<div class="rowContent">
								<span class='fl'>共3项服务</span>
								<div class="rightContent fr">
									<span class='txtLeft'>产品总额：<span class='fr'>30000元</span></span>
								</div>								
								<div class="clear"></div>
								</div>
								<div class="rowContent">
								<div class="rightContent fr">
								<span class='txtLeft'>优惠总额：<span class='fr'>-10000元</span></span>
								</div>
								<div class="clear"></div>
								</div>
								<div class="rowContent">
								<div class="rightContent fr">
								<span class='txtLeft'>实付款：<span class='fr'>27000元</span></span>
								</div>
								<div class="clear"></div>
								</div>
							</div>
						</div>
					</div>
					<div id="tab2" class="tab tabContent">
						<div class="tabContentRow">
							<span>订单详情</span>
						</div>
						<div class="tabContentRow checkList">
							
						</div>
						<div class="tabContentRow">
							<div class="rowContent">
								<div class="rowContent">
								<span class='fl'>共3项服务</span>
								<div class="rightContent fr">
									<span class='txtLeft'>产品总额：<span class='fr'>30000元</span></span>
								</div>								
								<div class="clear"></div>
								</div>
								<div class="rowContent">
								<div class="rightContent fr">
								<span class='txtLeft'>优惠总额：<span class='fr'>-10000元</span></span>
								</div>
								<div class="clear"></div>
								</div>
								<div class="rowContent">
								<div class="rightContent fr">
								<span class='txtLeft'>实付款：<span class='fr'>27000元</span></span>
								</div>
								<div class="clear"></div>
								</div>
								<div class="rowContent">
								<div class="rightContent fr">
								<span class='txtLeft'>分期数：<input id="picker" placeholder="选择分期数" readonly="" type="text"></span>
								</div>
								<div class="clear"></div>
								</div>
								<div class="rowContent">
								<div class="rightContent fr">
								<span class='txtLeft'>每期还款：<span class='fr'>750元</span></span>
								</div>
								<div class="clear"></div>
								</div>
							</div>
						</div>
					</div>					
				</div>
			</div>
			<div class="btn">
		<button>
			订单支付
		</button>
	</div>
		</div>
	<script src="js/zepto.min.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript" src="js/sui/sm.js" ></script>	
	<script type="text/javascript">
		$(function() {
			$(".tableLine input[type='checkbox']").click(function() {
				var $this = $(this);
				var dec = $this.siblings("span").text();
				var price = $this.parents(".tableLine").find(".rightpart span").text();
				var num = $this.data("num");
				var $checkList = $(".checkList");

				if($this.is(":checked")) {
					var _html = '<div class="rowContent" data-item="'+ num +'">'
							+'<span class="fl">'+dec+'</span>'
							+'<span class="fr">'+price+'元</span>'
							+'<div class="clear"></div>'
							+'</div>'	

					$checkList.append(_html);		
				}else {
					$checkList.find("div[data-item='"+num+"']").remove();					
				}

				//是否显示账单详情
				if($(".checkList .rowContent").length < 1) {
					$(".tabpanel").hide();
				}else {
					$(".tabpanel").show();
				}				
			})
			    $("#picker").picker({
      toolbarTemplate: '<header class="bar bar-nav">\
      <button class="button button-link pull-right close-picker">\
      确定\
      </button>\
      <h1 class="title">选择分期数</h1>\
      </header>',
      cols: [
        {
          textAlign: 'center',
          values: ['3期','6期', '9期', '12期','24期'],
          cssClass: 'picker-items-col-normal'
        }
      ]
    });
		})
	</script>	
	</body>

</html>